import request from '@/utils/request'

// 查询物料清单列表
export function listBom(query) {
  return request({
    url: '/system/bom/list',
    method: 'get',
    params: query
  })
}

// 查询物料清单详细
export function getBom(id) {
  return request({
    url: '/system/bom/' + id,
    method: 'get'
  })
}

// 新增物料清单
export function addBom(data) {
  return request({
    url: '/system/bom',
    method: 'post',
    data: data
  })
}

// 修改物料清单
export function updateBom(data) {
  return request({
    url: '/system/bom',
    method: 'put',
    data: data
  })
}

// 删除物料清单
export function delBom(id) {
  return request({
    url: '/system/bom/' + id,
    method: 'delete'
  })
}
// bom组件详情
export function bomParts(id){
  return request({
    url:'/system/bom/bomParts/'+id,
    method:'get'
  })
}
// bom操作详情
export function bomMsg(id){
  return request({
    url:'/system/bom/bomMsg/'+id,
    method:'get'
  })
}
// 物料清单新增跳转
export function bomAdd(data){
  return request({
    url:"/system/bom/bom_write",
    method:'post',
    data:data
  })
}
// 物料清单新增产品带出详情信息回填
export function bomdetail(id){
  return request({
    url:"/system/bom/bomPart_get/"+id,
    method:'get',
  })
}
// 物料清单订单行前置修改----新增时修改
export function bomedit(id){
  return request({
    url:"/system/bom/bomPart_info/"+id+"/t",
    method:'get',
  })
}
// 物料清单订单行前置修改----写入后修改
export function bomedit1(id){
  return request({
    url:"/system/bom/bomPart_info/"+id+"/f",
    method:'get',
  })
}
// 物料清单订单行修改提交
export function bomeditsub(data){
  return request({
    url:"/system/bom/bomPart_update",
    method:'put',
    data:data
  })
}
// 物料清单订单行删除----新增时
export function delorderzz(id) {
  return request({
    url: '/system/bom/bomPart_delete/'+id+'/t',
    method: 'get'
  })
}
// 物料清单订单行删除----写入后
export function delorderzz1(id) {
  return request({
    url: '/system/bom/bomPart_delete/'+id+'/f',
    method: 'get'
  })
}
// 物料清单 新增 放弃
export function cancelsale() {
  return request({
    url: '/system/bom/bomUpdate_abandon',
    method: 'get'
  })
}